﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZLCMS.Web.Wap.Code;
using DotNet.Common.NHibernateUtil;

namespace ZLCMS.Web.Wap.Shop
{
    public partial class MemberDefault : MemberPageBase
    {
        protected int UnReadNotice { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            UnReadNotice = 0;

            if (!string.IsNullOrEmpty(Session[ZLCMS.Business.Util.GlobalSessionString.CurrentMemberAccount] as string))
            {
                using (NHibernate.ISession session = SessionFactoryHelper.CreateSession())
                {
                    UnReadNotice = session.CreateSQLQuery("select recid from member_msg_kind where status='0' and member_account=:acc")
                        .SetParameter("acc", Session[ZLCMS.Business.Util.GlobalSessionString.CurrentMemberAccount] as string)
                        .SetMaxResults(1)
                        .UniqueResult<int>() ;
                }
            }

        }
    }
}